/*
 * capture-decoder.h
 *
 *  Created on: 2024年3月11日
 *      Author: NI
 */

#ifndef CAPTURE_DECODER_ACAMERA_TP2855_NO3_CAPTURE_DECODER_H_
#define CAPTURE_DECODER_ACAMERA_TP2855_NO3_CAPTURE_DECODER_H_

#include <stdint.h>
/*互斥锁*/
#include <pthread.h>

typedef struct {
	int i2c_fd;
	char i2c_path[20];
	uint8_t decoder_addr;
	uint8_t camera_use;
	uint8_t mipi_config;
	uint8_t channel[4];
	uint8_t fmt[4];
	uint8_t std[4];
	uint8_t connect_status;
	uint8_t lock_status;
	uint8_t read_back_flag;
	uint8_t mutex_flag;
	/*摄像头参数*/
	/*互斥锁*/
	pthread_mutex_t mutex;
}camera_decoder_t;

extern int camera_decoder_init(camera_decoder_t ** decoder);
extern int camera_decoder_deinit(camera_decoder_t * decoder);
extern int camera_decoder_read_reg(uint8_t page, uint8_t reg, uint8_t * value);
extern int camera_decoder_write_reg(uint8_t page, uint8_t reg, uint8_t value);
enum{
	DECODER_I2C_PATH = 0,//设置i2c路径并获得句柄
	DECODER_FMT,
	DECODER_STD,
	DECODER_READ_BACK_FLAG,
	DECODER_MUTEX_FLAG,
	DECODER_INIT_REG_MAP,
	DECODER_MIPI_OUT,
	DECODER_DUMP_REGISTER,
};
extern int camera_decoder_set_property(camera_decoder_t * decoder, int propetry, void * data);

#endif /* CAPTURE_DECODER_ACAMERA_TP2855_NO3_CAPTURE_DECODER_H_ */
